import { useAxios } from '@/hooks/web/useAxios'
import { ProHisVO,ProHisPageReqVO,ProHisExcelReqVO } from './types'

const request = useAxios()

// 查询生产历史列表
export const getProHisPageApi = async (params: ProHisPageReqVO) => {
    return await request.get({ url: '/water/pro-his/page', params })
}

// 查询生产历史详情
export const getProHisApi = async (id: number) => {
    return await request.get({ url: '/water/pro-his/get?id=' + id })
}

// 新增生产历史
export const createProHisApi = async (data: ProHisVO) => {
    return await request.post({ url: '/water/pro-his/create', data })
}

// 修改生产历史
export const updateProHisApi = async (data: ProHisVO) => {
    return await request.put({ url: '/water/pro-his/update', data })
}

// 删除生产历史
export const deleteProHisApi = async (id: number) => {
    return await request.delete({ url: '/water/pro-his/delete?id=' + id })
}

// 导出生产历史 Excel
export const exportProHisApi = async (params: ProHisExcelReqVO) => {
    return await request.download({ url: '/water/pro-his/export-excel', params })
}
